from urllib import request

url = 'http://httpbin.org/ip'

# 使用代理
handler = request.ProxyHandler({'http': '117.94.113.72:80'})
# 使用handler构建一个opener
opener = request.build_opener(handler)
# 使用opener发送请求
resp = opener.open(url)
print(resp.read())
